package com.ruoyi.commissionrecord.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.commissionrecord.mapper.CommissionRecordMapper;
import com.ruoyi.commissionrecord.domain.CommissionRecord;
import com.ruoyi.commissionrecord.service.ICommissionRecordService;

/**
 * 返佣记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-20
 */
@Service
public class CommissionRecordServiceImpl implements ICommissionRecordService 
{
    @Autowired
    private CommissionRecordMapper commissionRecordMapper;

    /**
     * 查询返佣记录
     * 
     * @param id 返佣记录主键
     * @return 返佣记录
     */
    @Override
    public CommissionRecord selectCommissionRecordById(Long id)
    {
        return commissionRecordMapper.selectCommissionRecordById(id);
    }

    /**
     * 查询返佣记录列表
     * 
     * @param commissionRecord 返佣记录
     * @return 返佣记录
     */
    @Override
    public List<CommissionRecord> selectCommissionRecordList(CommissionRecord commissionRecord)
    {
        return commissionRecordMapper.selectCommissionRecordList(commissionRecord);
    }

    /**
     * 新增返佣记录
     * 
     * @param commissionRecord 返佣记录
     * @return 结果
     */
    @Override
    public int insertCommissionRecord(CommissionRecord commissionRecord)
    {
        commissionRecord.setCreateTime(DateUtils.getNowDate());
        return commissionRecordMapper.insertCommissionRecord(commissionRecord);
    }

    /**
     * 修改返佣记录
     * 
     * @param commissionRecord 返佣记录
     * @return 结果
     */
    @Override
    public int updateCommissionRecord(CommissionRecord commissionRecord)
    {
        return commissionRecordMapper.updateCommissionRecord(commissionRecord);
    }

    /**
     * 批量删除返佣记录
     * 
     * @param ids 需要删除的返佣记录主键
     * @return 结果
     */
    @Override
    public int deleteCommissionRecordByIds(Long[] ids)
    {
        return commissionRecordMapper.deleteCommissionRecordByIds(ids);
    }

    /**
     * 删除返佣记录信息
     * 
     * @param id 返佣记录主键
     * @return 结果
     */
    @Override
    public int deleteCommissionRecordById(Long id)
    {
        return commissionRecordMapper.deleteCommissionRecordById(id);
    }
}
